﻿@using Portal.Frontend.UI.Helpers
@model RSHB.Frontend.UI.ViewModels.LoanAgreementBrowseViewModel

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="action_panel">
    <ul>
        <li>@Html.ImageActionAddLink("Создать", string.Empty, "Create", "LoanAgreement")</li>
    </ul>
</div>

<table class="list" cellspacing="0" cellpadding="0" border="0">
<thead>
    <tr>
        <td>Номер</td>
        <td>Заемщик</td>
        <td>Сумма</td>
        <td>Процентная ставка</td>
        <td>Дата заключения</td>
        <td>Дата возврата</td>
    </tr>
</thead>
<tfoot>
    <tr>
        <td colspan="5">Всего: @Model.LoanAgreements.Count</td>
    </tr>
</tfoot>
<tbody>
@foreach (var loanAgreement in Model.LoanAgreements)
{
    <tr>
        <td>@Html.ActionLink(@loanAgreement.LoanAgreementNum, "Edit", new { id = loanAgreement.LoanAgreementID })</td>
        <td>
            @Html.ActionLink(
                @loanAgreement.Borrower.FIO, "Edit", "Individual", new { id = loanAgreement.User.UserID }, null)
        </td>
        <td>@loanAgreement.LoanAgreementAmount.ToString("0.00")</td>
        <td>@loanAgreement.LoanAgreementRate.ToString("0.00")% (@loanAgreement.LoanAgreementFullRate.ToString("0.00")%)</td>
        <td>@loanAgreement.LoanAgreementIssueDate.ToString("dd.MM.yyyy")</td>
        <td>@loanAgreement.LoanAgreementRepaymentDate.ToString("dd.MM.yyyy")</td>
    </tr>
}
</tbody>
</table>
